import gym
from gym import wrappers

import time

#env = gym.make("BreakoutDeterministic-v4")
env = gym.make("BreakoutDeterministic-v4")
env = wrappers.Monitor(env, "./gym-results2", force=False)

print('观测空间 = {}'.format(env.observation_space))
print('动作空间 = {}'.format(env.action_space))
#print('回合最大步数 = {}'.format(env._max_episode_steps))

observation = env.reset()
for _ in range(5000):
  env.render()
  time.sleep(0.03)
  action = env.action_space.sample() # your agent here (this takes random actions)
  observation, reward, done, info = env.step(action)
  #print(observation, reward, done, info)

  if done:
    observation = env.reset()
    break
env.close()